Skip to content

add several ndarray method/properties #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2023
Merged

add several ndarray method/properties #101

merged 2 commits into from
Apr 4, 2023

Conversation

ev-br
Copy link
Collaborator

@ev-br ev-br commented Apr 3, 2023

No description provided.

@ev-br ev-br requested a review from lezcano April 3, 2023 14:25
Comment on lines 408 to 416
def item(self, *args):
if args == ():
return self.tensor.item()
elif len(args) == 1:
# int argument
return self.ravel()[args[0]]
else:
return self.__getitem__(args)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have tests for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at the moment. Don't see numpy tests in numpy proper either. Behavior with arrays seems legacy TBH, so I'd prefer to put it to the priority queue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you pulled this from the NumPy implementation, let's just add a link to it and roll with it.

@ev-br ev-br merged commit 3ec9dda into main Apr 4, 2023
@ev-br ev-br deleted the ndarray_attr branch April 4, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants